//using System;
//using System.Collections.Generic;
//using System.Threading;
//using Game500.ClientServerCommon;
//using Game500.ClientServerCommon.Actions;
//using Microsoft.Xna.Framework;

//namespace Game500.Client.Networking
//{
//  public class FakeClientNetworkManager : ClientNetworkManager
//  {
//    private readonly Dictionary<GamerActionType, GamerAction> myCurrentActions = new Dictionary<GamerActionType, GamerAction>();
//    private Renderable myBullet;
//    private SceneFrame myCurrentFrame;
//    private Renderable myPlayer;
//    private Vector3 myPlayerVelocity;

//    public override GameInfo GameInfo
//    {
//      get { return new GameInfo {PlayerId = 0, ScreenWidth = 1600, ScreenHeight = 1200}; }
//    }

//    public override void Connect(string host, int port)
//    {
//    }

//    public override SceneFrame GetActualFrame()
//    {
//      if (myCurrentFrame != null)
//      {
//        SceneFrame result = myCurrentFrame;
//        myCurrentFrame = null;
//        return result;
//      }

//      var frame = new SceneFrame();

//      var player = new ObjectDescriptor(myPlayer.Id, 0) {Position = myPlayer.Position, Rotation = myPlayer.Rotation};

//      var bullet = new ObjectDescriptor(myBullet.Id, 3) {Position = myBullet.Position};

//      frame.DataSection = new List<ObjectDescriptor> {player, bullet};

//      return frame;
//    }

//    public override void Initialize()
//    {
//      var plane = new ObjectDescriptor(0, 0);
//      var back = new ObjectDescriptor(1, 1);
//      var data = new List<ObjectDescriptor> {plane, back};
//      myPlayer = new Renderable(0);
//      myBullet = new Renderable(3) {Velocity = new Vector3(0.1f, 0.05f, 0.0f) * 100, Position = new Vector3(0, 0, 0.1f)};
//      myCurrentFrame = new SceneFrame {DataSection = data};
//      new Thread(x =>
//                  {
//                    Thread.Sleep(1000);
//                    RaiseGameStartEvent(0);
//                  }).Start();
//    }

//    public override void Update()
//    {
//      myPlayerVelocity *= 0.95f;
//      if (myPlayer == null) return;
//      const float speed = 100;
//      const float rotationSpeed = (float)Math.PI / 50;
//      Vector3 force = Vector3.Zero;

//      GamerAction action;
//      if (myCurrentActions.TryGetValue(GamerActionType.TangageChangeAction, out action)) myPlayer.Rotation += action.Value * rotationSpeed;
//      if (myCurrentActions.ContainsKey(GamerActionType.ThrottleChangeAction))
//      {
//        force.X -= speed * (float)Math.Cos(myPlayer.Rotation);
//        force.Y += speed * (float)Math.Sin(myPlayer.Rotation);
//      }

//      const float mass = 100f;
//      force.Y += 20;
//      myPlayerVelocity -= force / mass;

//      myPlayer.Position = myPlayer.Position + myPlayerVelocity;

//      const float sceneBottom = 440;
//      const float sceneLeft = -20;
//      const float sceneRight = 1600;
//      if (myPlayer.Position.Y < 0) myPlayer.Y = 0;
//      if (myPlayer.X < sceneLeft) myPlayer.X = sceneRight;
//      if (myPlayer.X > sceneRight) myPlayer.X = sceneLeft;

//      if (myBullet.X < sceneLeft || myBullet.X > sceneRight) myBullet.Velocity = new Vector3(-myBullet.Velocity.X, myBullet.Velocity.Y, myBullet.Velocity.Z);
//      if (myBullet.Y > sceneBottom || myBullet.Y < 0) myBullet.Velocity = new Vector3(myBullet.Velocity.X, -myBullet.Velocity.Y, myBullet.Velocity.Z);
//      //myBullet.Position += myBullet.Velocity;

//      myCurrentActions.Clear();
//    }
//  }
//}

